package io.arukas;

import io.arukas.service.HelloService;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ComponentScan;

/**
 * Created by IntelliJ IDEA. <br/>
 *
 * @Auther: 牛玉贤 <br/>
 * @Date: 2019/9/16 16:12 <br/>
 * @Email: ncc0706@gmail.com <br/>
 */
@ComponentScan("io.arukas")
public class AnnotationSampleApp {

	public static void main(String[] args) {

		AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(AnnotationSampleApp.class);

		String[] beans = context.getBeanDefinitionNames();
		for (String bean : beans) {
			System.out.println(bean);
		}

		HelloService helloService = context.getBean("helloService", HelloService.class);
		helloService.sayHello();
	}

}
